package org.ichow.scenegame.controller
{
	import org.ichow.scenegame.model.AssetsProxy;
	import org.ichow.scenegame.model.MusicProxy;
	import org.ichow.scenegame.SceneGameFacade;
	import org.ichow.scenegame.view.SceneMediator;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand

	/**
	 * ...
	 * 开始命令
	 * 注册素材和视图
	 * @author M.ichow
	 */
	public class StartupCommand extends SimpleCommand
	{

		public function StartupCommand()
		{
			super();
		}

		override public function execute( notification : INotification ) : void
		{
			super.execute( notification );
			//注册主场景
			var app : Main = notification.getBody() as Main;
			facade.registerMediator( new SceneMediator( app ) );
			//注册视图初始
			facade.registerCommand( AssetsProxy.ASSETS_COMPLETE , ViewPrepCommand );
			//外部接口
			facade.registerCommand( SceneGameFacade.EXTERNAL_CALL , ExternalCommand );
			//注册素材
			facade.registerProxy( new AssetsProxy( app.getValueForKey( "flashPath" ) as String ) );
			//背景音乐
			//facade.registerProxy( new MusicProxy( app.getValueForKey( "flashPath" ) as String ,  ) );
		}

	}

}